let getConfigUrl = '/api/config/getconfig'
// let getStoresUrl = '/api/store/all'
let getCardsPageUrl = '/api/card/getCardsPage'
let getCardInfoUrl = '/api/card/getCardInfo'
let getUserPhoneFromMPUrl = '/api/user/mpWeixinDecodePhone'
let getUserPhoneFromMPNewUrl = '/api/user/mpWeixinGetPhone'
let createTransactionUrl = '/api/payment/createTransaction'
let balancePayUrl = '/api/reserve/balancePay'
let cardPayUrl = '/api/reserve/cardPay'
let otherPayUrl = '/api/reserve/otherPay'
// let getMyReserveUrl = '/api/reserve/getMyReserve'
let getDirectPayOrderUrl = '/api/user/getDirectPayOrder'
let exchangeDZMTUrl = '/api/user/exchangeDZMT'

let getPromotionDetailUrl = '/api/promotion/detail'


const mpWeixinRegisterAndLoginUrl = '/api/login/mpWeixinRegisterAndLogin'//�û���¼
const getUserInfoUrl = '/api/user/getUserInfo' //��ȡ�û���Ϣ
const setUserInfoUrl = '/api/user/saveUserInfo'//�����û���Ϣ
const getUserBalancePageUrl = '/api/user/getUserBalancePage' //���
const getMyCardsUrl = '/api/user/getMyCards' //�ҵĿ�ȯ
const getUserCardDetailUrl = '/api/user/getUserCardDetail' //��ȡ��ȯ����
const getUserAllCouponUrl = '/api/user/getUserAllCoupon' //��ȡ�Ż�ȯ
const getUserAllReservationUrl = '/api/user/getUserAllReservation' //��ȡԤԼ
const submitApplyCooperationUrl = '/api/user/applyCooperation' //��ҵ����
const submitApplySuggestionUrl = '/api/user/applySuggestion' //�������
const getMyReserveListUrl = '/api/reserve/getMyReserveList' //ԤԼ�б�
const cancelMyReserveUrl = '/api/reserve/cancelMyReserve' //ȡ��ԤԼ
const getMyReserveDetailUrl = '/api/reserve/getMyReserve' //ԤԼ����
const getCouponListUrl = '/api/coupon/list' //�Ż�ȯ�б�
const submitTakecouponUrl = '/api/coupon/takecoupon' //��ȡ�Ż�ȯ
const getChargeOptionsUrl = '/api/pay/getChargeOptions' //��ȡ��ֵ
const getStoresUrl = '/api/store/all' //��ȡȫ���ŵ�
const getPromotionUrl = '/api/promotion/list' //��ҳbanner
const getStorePageUrl = '/api/store/baseinfo' //�ŵ�����
const getRoomPageUrl = '/api/room/baseinfo' //��������
const reserveInitUrl = '/api/reserve/init' //����ԤԼʱ��
const getRentTimePillUrl = '/api/reserve/getRentTimePill' //�õ�ĳһ���ԤԼ��ʱ��
const getPayPageInfoUrl = '/api/reserve/getPayPageInfo' //�ύԤԼ��Ϣ
const getVoucherPayPageInfoUrl = '/api/reserve/getVoucherPayPageInfo' //����ȯ֧��
const getUserUnusedCouponUrl = '/api/user/getUserUnusedCoupon' //�ҵĿ����Ż�ȯ
const logoutUrl = '/api/user/logout' //�˳�
const getAgreeMentUrl = '/api/agreement/getagreement' //��ȡЭ������

const userLoginApiUrl = '/api/login/mpWeixinLogin'

const deleteReservationApiUrl = '/api/reserve/delete'

const checkNameAndIdCardUrl = '/api/user/checkNameAndIdCard' //ʵ����֤
const getCreditLogsUrl = '/api/user/getCreditLogs' //���÷��б�
const selectPaysUrl = '/api/reserve/selectPay' //֧����ʽѡ��-ѡ��ȯ֧��

const getMyRecentReserveListUrl = '/api/reserve/getMyRecentReserveList' // �õ��������ԤԼ
const getOrderTmpPasswdUrl = '/api/reserve/getOrderTmpPasswd' // �õ�ȡ��������ʱ����
const getCleanRoomListUrl = '/api/room/getCleanRoomList' //õȡ
const openElectricUrl = '/api/room/openElectric' //通电
const testPayUrl = '/api/pay/payToUser' //测试提现

const install = (Vue, vm) => {

	let getConfig = () => vm.$u.get(getConfigUrl)


	let getCardsPage = (data) => vm.$u.get(getCardsPageUrl, data)
	let getCardInfo = (data) => vm.$u.get(getCardInfoUrl, data)

	let getUserPhoneFromMP = (data) => vm.$u.post(getUserPhoneFromMPUrl, data)
	let getUserPhoneFromMPNew = (data) => vm.$u.post(getUserPhoneFromMPNewUrl, data)
	let createTransaction = (data) => vm.$u.post(createTransactionUrl, data)

	let balancePay = (data) => vm.$u.post(balancePayUrl, data)
	let otherPay = (data) => vm.$u.post(otherPayUrl, data)
	let cardPay = (data) => vm.$u.post(cardPayUrl, data)

	let getMyReserve = (data) => vm.$u.get(getMyReserveUrl, data)

	let getDirectPayOrder = (data) => vm.$u.get(getDirectPayOrderUrl, data)



	let exchangeDZMT = (data) => vm.$u.get(exchangeDZMTUrl, data)


	let getPromotionDetail = (data) => vm.$u.get(getPromotionDetailUrl, data)
	
	//new
	const getUserBalancePage = (data) => vm.$u.get(getUserBalancePageUrl, data)
	const setUserInfo = (data) => vm.$u.post(setUserInfoUrl, data)
	const getUserInfo = () => vm.$u.get(getUserInfoUrl)
	const getMyCards = () => vm.$u.get(getMyCardsUrl)
	const getUserCardDetail = (data) => vm.$u.get(getUserCardDetailUrl, data)
	const mpWeixinRegisterAndLogin = (data) => vm.$u.post(mpWeixinRegisterAndLoginUrl, data)
	const getUserAllCoupon = (data) => vm.$u.get(getUserAllCouponUrl, data)
	const getUserAllReservation = (data) => vm.$u.get(getUserAllReservationUrl, data)
	const submitApplyCooperation = (data) => vm.$u.post(submitApplyCooperationUrl, data)
	const submitApplySuggestion = (data) => vm.$u.post(submitApplySuggestionUrl, data)
	const getMyReserveList = (data) => vm.$u.get(getMyReserveListUrl, data)
	const getMyReserveDetail = (data) => vm.$u.get(getMyReserveDetailUrl, data)
	const cancelMyReserve = (data) => vm.$u.get(cancelMyReserveUrl, data)
	const getCouponList = (data) => vm.$u.get(getCouponListUrl, data)
	const submitTakecoupon = (data) => vm.$u.post(submitTakecouponUrl, data)
	const getChargeOptions = (data) => vm.$u.get(getChargeOptionsUrl, data)
	const getStores = () => vm.$u.get(getStoresUrl)
	const getPromotion = () => vm.$u.get(getPromotionUrl)
	const getStorePage = (data) => vm.$u.get(getStorePageUrl, data)
	const getUserUnusedCoupon = (data) => vm.$u.get(getUserUnusedCouponUrl, data)
	const reserveInit = (data) => vm.$u.get(reserveInitUrl, data)
	const getRentTimePill = (data) => vm.$u.get(getRentTimePillUrl, data)
	const getPayPageInfo = (data) => vm.$u.post(getPayPageInfoUrl, data)
	const getVoucherPayPageInfo = (data) => vm.$u.post(getVoucherPayPageInfoUrl, data)
	const getRoomPage = (data) => vm.$u.get(getRoomPageUrl, data)
	const logout = (data) => vm.$u.post(logoutUrl, data)
	const getAgreeMent = (data) => vm.$u.get(getAgreeMentUrl, data)
	
	const userLoginApi = (data) => vm.$u.post(userLoginApiUrl, data)
	const userRegisterApi = (data) => vm.$u.post(userRegisterApiUrl, data)
	
	const deleteReservationApi = (data) => vm.$u.post(deleteReservationApiUrl, data)
	
	const checkNameAndIdCardApi = (data) => vm.$u.post(checkNameAndIdCardUrl, data)
	const getCreditLogsApi = (data) => vm.$u.post(getCreditLogsUrl, data)
	const selectPaysApi = (data) => vm.$u.post(selectPaysUrl, data)
	
	const getMyRecentReserveList = (data) => vm.$u.get(getMyRecentReserveListUrl, data)
	const getOrderTmpPasswd =  (data) => vm.$u.get(getOrderTmpPasswdUrl, data)
	const getCleanRoomList =  (data) => vm.$u.get(getCleanRoomListUrl, data)
	const openElectric =  (data) => vm.$u.get(openElectricUrl, data)
	const testPay =  (data) => vm.$u.get(testPayUrl, data)

	//�
	vm.$u.api = {
		getConfig,
		getCardsPage,
		getCardInfo,
		mpWeixinRegisterAndLogin,
		getUserInfo,
		setUserInfo,
		getUserPhoneFromMP,
		getUserPhoneFromMPNew,
		createTransaction,
		balancePay,
		cardPay,
		otherPay,
		getMyReserve,
		cancelMyReserve,

		getDirectPayOrder,

		getUserBalancePage,
		getMyCards,
		getUserCardDetail,

		exchangeDZMT,
		getPromotionDetail,
		
		//
		getUserAllCoupon,
		getUserAllReservation,
		submitApplyCooperation,
		submitApplySuggestion,
		getMyReserveList,
		getMyReserveDetail,
		getCouponList,
		submitTakecoupon,
		getChargeOptions,
		getStores,
		getPromotion,
		getStorePage,
		getUserUnusedCoupon,
		reserveInit,
		getRentTimePill,
		getPayPageInfo,
		getVoucherPayPageInfo,
		getRoomPage,
		logout,
		getAgreeMent,
		
		userLoginApi,
		userRegisterApi,
		
		deleteReservationApi,
		
		
		checkNameAndIdCardApi,
		getCreditLogsApi,
		selectPaysApi,
		
		getMyRecentReserveList,
		getOrderTmpPasswd,
		getCleanRoomList,
		openElectric,
		testPay,
	};

}

export default {
	install
}